package chapter06.e1;

import com.sun.xml.internal.bind.v2.schemagen.xmlschema.List;

import java.util.ArrayList;

public class e1 {
    public static void main(String[] args) {
        ArrayList list = new ArrayList<>();
        list.add("张三");
        list.add("李四");
        list.add("王五");
        list.add("赵六");
        list.add(Math.PI);
        //查看list长度)
        System.out.println("集合长度："+list.size());
        System.out.println(list);;
        ///查看指定位置元素
        System.out.println("第2个元素是："+list.get(1));
        //修改指定元素
        list.set(2,"王小明");
        System.out.println(list);
        list.add(2,"隔壁老王");
        System.out.println(list);
        list.remove(5);
        System.out.println(list);
    }
}
